<?php
class faq_model extends CI_Model {
    public function __construct() {
        $this->sws = $this->load->database ( 'sws', TRUE );
    }
    public function get_faq_type() {
        $sql = "select  *  from sdk_faq_type    ";
        $query = $this->sws->query ( $sql );
        if ($query->num_rows () > 0) {
            return $query->row_array ();
        }
    }
    public function get_faq_list($type_id) {
        $type_id = $this->db->escape ( $type_id );
        $sql = "select  FAQ_TITLE,FAQ_CONTENT  from sdk_faq   where TYPE_ID = $type_id ";
        $query = $this->sws->query ( $sql );
        if ($query->num_rows () > 0) {
            return $query->row_array ();
        }
    }
    public function get_faq_info($faq_id) {
        $type_id = $this->db->escape ( $type_id );
        $sql = "select  *  from sdk_faq   where FAQ_ID = $faq_id ";
        $query = $this->sws->query ( $sql );
        if ($query->num_rows () > 0) {
            return $query->result_array ();
        }
    }
}




